use 5.010;
use strict;

open FILE, "<:utf8", "C:\\Documents and Settings\\R19338\\Desktop\\gerry_weber_de_dev11_1227.xml";


my $count = 0;
my $file = 1;
my $content = '';
while(<FILE>){
	chomp;
	$content .= $_."\n";
	if($_ =~ /<\/Product>/is){
		$count++;
		if($count){
			if ($count > 199){
				open WFILE, ">:utf8", "C:\\Documents and Settings\\R19338\\Desktop\\split$file.txt";
				print WFILE $content;
				$file++;
				close WFILE;
				$count -= 200;
				$content = '';
			}
			else {
				open WFILE, ">:utf8", "C:\\Documents and Settings\\R19338\\Desktop\\split0.txt";
				print WFILE $content;
				close WFILE;
			}
		}
	}
}